<?php
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Runescapegold2007</title>
        <link href="<?php echo Yii::app()->theme->baseUrl; ?>/css/bootstrap.css" rel="stylesheet" media="screen">
        <link href="<?php echo Yii::app()->theme->baseUrl; ?>/css/default.css" rel="stylesheet" media="screen">
    </head>
    <body>
        <div class="top"><!--Top-->
            <div class="navbar navbar-static-top navbar-inverse">
                <div class="navbar-inner">
                    <div class="container">
                        <ul class="nav">
                            <li><a href="#">About Us</a></li>
                            <li class="divider-vertical"></li>
                            <li><a href="gold.html">Count Us</a></li>
                            <li class="divider-vertical"></li>
                            <li><a href="<?php echo Yii::app()->createAbsoluteUrl('order/cart');?>">Shopping Cart</a></li>
                            <li class="divider-vertical"></li>
                            <li><a href="<?php echo Yii::app()->createAbsoluteUrl('site/sign'); ?>">Join In</a></li>
                            <li class="divider-vertical"></li>
                            <li>
                                <?php 
                                if(Yii::app()->user->isGuest):
                                    echo CHtml::link('Login', Yii::app()->createAbsoluteUrl('site/login'));
                                else:
                                    echo CHtml::link('Logout', Yii::app()->createAbsoluteUrl('site/logout'));
                                endif;
                                ?>
                            </li>
                        </ul>
                    </div>
                </div>

            </div>
        </div>

        <div class="header"><!--Header-->
            <div class="container">
                <div class="row">
                    <div class="span8">
                        <a href="<?php echo Yii::app()->homeUrl;?>" class="logo"><?php echo $this->webOptions->site_name;?></a>
                    </div>
                    <div class="span4">
                        <div class="cart">
                            <div class="shopping">
                                <span>Your Cart is <a id="cart_number" href="<?php echo Yii::app()->createAbsoluteUrl('order/cart');?>" style="color:#e99e32"><?php $cart = new Cart;echo $cart->cartNum();?></a> Item</span><strong><a href="<?php echo Yii::app()->createAbsoluteUrl('order/cart');?>">Check Out</a></strong>
                            </div>  
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="menus"><!--Menus-->
            <div class="navbar navbar-static-top navbar-inverse">
                <div class="navbar-inner">
                    <div class="container">
                        <ul class="nav">
                            <li><a href="<?php echo Yii::app()->homeUrl; ?>">Home</a></li>
                            <?php
                            foreach (SubsiteCategory::model()->getCategoryTree() as $c):
                                $master = $c['master'];
                                $css_class = '';
                                $toggle = '';
                                $sub = array();
                                if (isset($c['sub'])) {
                                    $sub = $c['sub'];
                                    $css_class = 'class="dropdown"';
                                    $toggle = 'class="dropdown-toggle" data-toggle="dropdown"';
                                }
                                ?>
                                <li <?php echo $css_class; ?>>
                                    <a href="<?php echo $this->createCategoryUrl(array('master' => $master->title_alias), $master->product_model); ?>" <?php echo $toggle; ?>><?php echo $master->title; ?></a>
                                    <?php
                                    if (!empty($sub)):
                                        ?>
                                        <ul class="dropdown-menu">
                                            <?php foreach ($sub as $s): ?>
                                            <li><a href="<?php echo $this->createCategoryUrl(array('master' => $master->title_alias, 'alias' => $s->title_alias), $s->product_model);?>"><?php echo $s->title;?></a></li>
                                            <?php endforeach; ?>
                                        </ul>
                                        <?php
                                    endif;
                                    ?>
                                </li>
                                <?php
                            endforeach;
                            ?>
                                <li><?php echo CHtml::link('Testimonies', Yii::app()->createAbsoluteUrl('testimonies/index'));?></li>
                        </ul>
                    </div>
                </div>

            </div>
        </div>

        <div class="man">
            <div class="container">
                <?php echo $content; ?>
            </div>
        </div>

        <div class="footer-menu"><!--Footer-->
            <div class="navbar navbar-static-top navbar-inverse">
                <div class="navbar-inner">
                    <div class="container">
                        <ul class="nav">
                            <li><a href="#">About Us</a></li>
                            <li class="divider-vertical"></li>
                            <li><a href="gold.html">Count Us</a></li>
                            <li class="divider-vertical"></li>
                            <li><a href="#">Shopping Cart</a></li>
                            <li class="divider-vertical"></li>
                            <li><a href="#">Join In</a></li>
                            <li class="divider-vertical"></li>
                            <li><a href="#">Login</a></li>
                        </ul>
                        <ul class="nav pull-right">
                            <li><a href="#">Top <i class="icon-chevron-up"></i></a></li>
                        </ul>
                    </div>
                </div>

            </div>
        </div>
        <div class="footer">
            <div class="container">

                <p>
                    <img src="<?php echo Yii::app()->theme->baseUrl; ?>/img/master.jpg" />
                    <img src="<?php echo Yii::app()->theme->baseUrl; ?>/img/visa.jpg" />
                    <img src="<?php echo Yii::app()->theme->baseUrl; ?>/img/paypal.jpg" />
                </p>
                <p>This website and its contents are copyright © 2013 google.com</p>
            </div>
        </div>

        <script src="<?php echo Yii::app()->theme->baseUrl; ?>/js/bootstrap.min.js"></script>
        <script>
            $(function(){
                $('.carousel').carousel({
                    interval: 3000
                });
            });
        </script>
    </body>
</html>